using UnityEngine;

namespace AutoChess
{
    public class BUnityUtil
    {
        public static Transform FindChildByName(Transform root, string targetName)
        {
            var childs = root.childCount;
            if (childs > 0)
            {
                for (int i = 0; i < childs; i++)
                {
                    var child = root.GetChild(i);
                    if (child.name.Equals(targetName))
                    {
                        return child;
                    }
                    else
                    {
                        FindChildByName(child, targetName);
                    }
                }
            }

            return null;
        }

        public static void SetLayer(GameObject go, string layer)
        {
            
        }
    }
}